package cn.dm.service;

import cn.dm.client.RestDmItemCommentClient;
import cn.dm.mapper.DmItemCommentMapper;
import cn.dm.pojo.DmItemComment;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@RestController
public class DmItemCommentController {
    @Resource
    private DmItemCommentMapper restDmItemCommentClient;

    @RequestMapping(value = "/getDmItemCommentById",method = RequestMethod.POST)
    public DmItemComment getDmItemCommentById(@RequestParam("id") Long id)throws Exception{
        return restDmItemCommentClient.getDmItemCommentById(id);
    }

    @RequestMapping(value = "/getDmItemCommentListByMap",method = RequestMethod.POST)
    public List<DmItemComment> getDmItemCommentListByMap(@RequestBody Map<String, Object> param)throws Exception{
        return restDmItemCommentClient.getDmItemCommentListByMap(param);
    }

    @RequestMapping(value = "/getDmItemCommentCountByMap",method = RequestMethod.POST)
    public Integer getDmItemCommentCountByMap(@RequestBody Map<String, Object> param)throws Exception{
        return restDmItemCommentClient.getDmItemCommentCountByMap(param);
    }

    @RequestMapping(value = "/qdtxAddDmItemComment",method = RequestMethod.POST)
    public Integer qdtxAddDmItemComment(@RequestBody DmItemComment dmItemComment)throws Exception{
        return restDmItemCommentClient.insertDmItemComment(dmItemComment);
    }

    @RequestMapping(value = "/qdtxModifyDmItemComment",method = RequestMethod.POST)
    public Integer qdtxModifyDmItemComment(@RequestBody DmItemComment dmItemComment)throws Exception{
        return restDmItemCommentClient.updateDmItemComment(dmItemComment);
    }
}
